package reentrant;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Test_synchronized_Runnable implements Runnable {
    public synchronized void outer() {
        log.info("currentThread: " + Thread.currentThread().getId());
        inner();
    }

    public void inner() {
        log.info("currentThread: " + Thread.currentThread().getId());
    }

    @Override
    public void run() {
        outer();
    }

    public static void main(String[] args) throws InterruptedException {
        Test_synchronized_Runnable test = new Test_synchronized_Runnable();
        new Thread(test).start();
        new Thread(test).start();
        new Thread(test).start();

        System.out.println("成功");
    }
}
